fix(cloud): salvage comment listing rows per-row - #731
Merged
Conversation
cloud_list_session_comments parsed all-or-nothing: one malformed row, a mention list past this client's outbound cap, or a NEWER backend's kind/resolution enum value zod-failed the whole listing, pinning that session's comment pane in error-retry for every member with no way to attribute the culprit. Apply the tolerant-record rule the sessions listing already follows: parse rows individually and drop only the bad one, naming the first casualty (id + first zod issue) in a rate-limited diagnostic; degrade unknown kind/resolution values to their absent-field semantics instead of failing; stop re-checking the 50-mention cap on read. Pre-commit hook ran. Total eslint: 18, total circular: 0
Neonforge98
force-pushed
the
fix/tolerant-comment-listing-rows
branch
from
August 6, 2026 20:50
033c1df to
d31a008
Compare
Same all-or-nothing class as the comments listing: one malformed mention row zod-failed the whole cloud_list_team_inbox_mentions page, blanking the Team Inbox instead of costing the one row. Parse rows individually, name the first casualty, and keep rejecting a malformed page envelope (unreadCount/cursor) outright. Pre-commit hook ran. Total eslint: 18, total circular: 0
Neonforge98
force-pushed
the
fix/tolerant-comment-listing-rows
branch
from
August 6, 2026 21:28
d31a008 to
515c5dc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Two cloud listing reads on the comments plane parsed all-or-nothing:
1.
cloud_list_session_comments(z.array(CloudSessionCommentWireSchema)). Any of the following zod-failed the entire listing:mentionedUserIdsexceeds this client's outbound 50-cap (read-side.max(50)re-check),kindorresolutionenum value this client doesn't know.The atom layer then pins that session's comment pane in
state:"error"with exponential retry — for every member, indefinitely, and the diagnostic names neither the row nor the field.2.
cloud_list_team_inbox_mentions— one malformed mention row blanked the whole Team Inbox page the same way.This is the class the sessions listing already survives per-row (tolerant-record sweep, #698/#728); these were the remaining all-or-nothing reads on the sharing surface.
Fix (mirrors the sessions-listing idiom)
z.unknown()[]+ per-rowsafeParse: a bad row is dropped alone and the first casualty is named (id + first zod issue path/message) in a rate-limited warn.kind/resolutionget.catch(undefined): an unknown enum value degrades to its documented absent-field semantics ('user' / plain resolve) — the row survives..max(50)onmentionedUserIdsremoved; the cap stays enforced where it protects something (outbound request build, server RPC).unreadCount, cursors) still rejects outright — tolerance is per-row, not anything-goes.Verification
kind/resolutiondegrade with row kept, 60-mention row kept on read.Found by the escape-class audit (cross-version + adversarial-row lenses) over the session-sharing surface.